﻿using OrganizationName.CodeGeneration;
namespace OrganizationName.Factory
{
    public class Literal : GenericMaterial
    {
        public virtual string Data { get; set; }

        public override System.CodeDom.CodeExpression ToRightHandSideExpression(ICodeContext codeContext)
        {
            return new System.CodeDom.CodeSnippetExpression(Data);
        }

        public override void DeclarationPhase(ICodeContext codeContext)
        {
        }

        public override void InitializationPhase(ICodeContext codeContext)
        {
        }

        public override void FinalizationPhase(ICodeContext codeContext)
        {
        }

        public override System.Type GetAbstractType(ICodeContext codeContext)
        {
            return (codeContext.ParentContext.CodeProvider as GenericMaterial).GetAbstractType(codeContext.ParentContext);
        }

        public override System.Type GetConcreteType(ICodeContext codeContext)
        {
            return (codeContext.ParentContext.CodeProvider as GenericMaterial).GetConcreteType(codeContext.ParentContext);
        }
    }
}
